<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    这个是es6学习初始化页面吗
    <script>
        //var 声明的变量会越域
        //let 声明的变量严格作为局部变量
        // {
        //     var a = 123
        //     let b = 456
        // }
        // console.log(a)
        // console.log(b) // let.html:19 Uncaught ReferenceError: b is not defined at let.html:19:21

        //const定义常量，不允许改变
        // const a = 1
        // alert(a)
        // a = 2 //let.html:24 Uncaught TypeError: Assignment to constant variable.
        // alert(a)

        
    </script>
</body>
</html>